<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="../vue.js"></script>
</head>

<body>
  <div id="app">
    <!-- 数组写法, 数组中传入一个对象,可以传入多个对象,逗号隔开, 对象写的是{key(属性名) : value(属性值)} -->
    <h2 :style=[baseStyle]>你好啊</h2>
  </div>
  <script>
    const app = new Vue({
      el: "#app",
      data: {
        baseStyle: {
          backgroundColor: "red"
        }
      }
    })
  </script>
</body>

</html>